/**
 * 公共函数
 */
define(["jquery"], function($) {

	'use strict';	
	

	

	var public_method = {
		
		/**
		 * 打开或关闭详情页面
		 * @param _options.target
		 */
		
		togglePanel : function(_options) {
			var _queryParam = {}
			//获取当前模块配置
			var _target
			
			if(_options && _options.target && _options.target.length>0){
				_target= _options.target
				if(_target.length>0){
					
					var _tmp,isClosed
					var _tmpPanel = $(_target).closest('div.panel')
					isClosed=$(_tmpPanel).attr('style')					
					 
					if(isClosed){
						isClosed = isClosed.toLowerCase();
						_tmp = isClosed.indexOf('display: none')
						if(_tmp<0){
							_target.panel('close')
						}else{
							_target.panel('open')
						}
					}
						
					
				}
			}
		},
		/**
		 * 打开或关闭详情页面
		 * @param _options.target
		 */
		
		getPanelState : function(_options) {
			var retVal = 0
			//获取当前模块配置
			var _target
			
			if(_options && _options.target && _options.target.length>0){
				_target= _options.target
				if(_target.length>0){
					
					var _tmp,isClosed
					var _tmpPanel = $(_target).closest('div.panel')
					isClosed=$(_tmpPanel).attr('style')					
					 
					if(isClosed){
						isClosed = isClosed.toLowerCase();
						_tmp = isClosed.indexOf('display: none')
						if(_tmp<0){
							retVal = 1
						}
					}					
				}
			}
			return retVal
		}
		
	}
	
	return public_method
});
